<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Bilibili 外链/嵌入代码生成器 HTML5</title>
<meta name="viewport" content="width=device-width" />
<style type="text/css" media="screen">
body {
	background-color: #f1f1f1;
	margin: 0;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.container { margin: 50px auto 40px auto; text-align: center; max-width: 600px; }

a { color: #4183c4; text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { position:relative; letter-spacing: -1px; line-height: 60px; font-size: 60px; font-weight: 100; margin: 0px 0 50px 0; text-shadow: 0 1px 0 #fff; }
p { color: rgba(0, 0, 0, 0.5); margin: 20px 0; line-height: 1.6; }

#more {
	margin-top: 35px;
	color: #ccc;
}
#more a {
	color: #666666;
	font-weight: 200;
	font-size: 14px;
	margin: 0 10px;
}
</style>
<script type="text/javascript" charset="utf-8" src="https://cdnjs-com.b0.upaiyun.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>

<div class="container">

<h1>Bilibili 外链/嵌入代码生成器</h1>
<p>直接生成永久可用的外链（建议上传 MP4 格式视频，兼容性更好）</p>
<p>可以放在自己的播放器中，利用 HTML5 的 <code>&lt;video&gt;</code> 进行播放，无需 Flash。</p>

<script>
function short() {
	$("#result").text("Loading…");
	$.get(
		'/getlink.php',
		'url=' + encodeURIComponent($("#setUrl").val()),
		function(data,status)
		{
			if(data == 'ERROR'){
				alert('不是有效的链接，请重新输入！');
				$("#result").text("ERROR");
			} else {
				$("#result").text("");
				$("#result").text('https://bilidown.tlo.xyz/link.php/' + data);
				$("#result2").text('<iframe src="https://bilidown.tlo.xyz/embed.php/' + data + '" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen scrolling="no"></iframe>');
			}
		},
		"text"
	);
};
</script>
<input id="setUrl" type="text" name="url" placeholder="http://www.bilibili.com/video/av12345678/" style="clear: both; font-size: 1.5em; margin: auto; width: 100%; border: 0; background-color: #f1f1f1; border-bottom: 2px solid #a2a2a2; text-align: center; margin-top: 2em;" onchange="short()">

<textarea onclick="this.focus();this.select()" style="font-size: 120%; width: 100%; height: 2.5em; clear: both; margin: auto; border: 0; background-color: #f1f1f1; text-align: center; resize: none !important;border-bottom: 2px solid #a2a2a2;" id="result" readonly="readonly"></textarea>

<p style="text-align: left; margin: 0 ">嵌入代码：</p>

<textarea onclick="this.focus();this.select()" style="font-size: 100%;width: 100%;font-family: monospace;height: 5em;clear: both;margin: auto;background-color: #f1f1f1;resize: none !important;" id="result2" readonly="readonly"></textarea>

<div id="more">
	<a href="https://www.fuckbilibili.com/bililink.html">About this service</a>
</div>
</body>
</html>
